<template
  ><div class="section_2 flex-col">
    <div class="section_4 flex-col justify-end">
      <span class="text_9">开标记录</span>
      <a-table :columns="columns" pagination="false" :data-source="data"> </a-table>
    </div>
  </div>
</template>
<script>
const columns = [
  {
    key: 'bidderUserId',
    dataIndex: 'bidderUserId',
    title: '序号',
  },
  {
    title: '投标人',
    key: 'bidderName',
    dataIndex: 'bidderName',
  },
  {
    title: '报价(元)',
    dataIndex: 'bidPrice',
    key: 'bidPrice',
  },
  {
    title: '工期(天)',
    dataIndex: 'timeLimit',
    key: 'timeLimit',
  },
]

export default {
  name: 'open-record',
  data() {
    return { data: [], columns, constants: {}, list: [] }
  },
  created() {
    this.getData()
  },
  watch: {
    $route(to, from) {
      // console.log(from.path); // 从哪来
      console.log(to.query) // 到哪去
      this.getData()
    },
  },
  methods: {
    getData() {
      this.$http
        .get('/exKaibiao/exTender/detailList', {
          params: {
            bidSectionId: this.$route.query.bidSectionId,
          },
        })
        .then(r => {
          if (r.result.length) {
            this.columns = [
              ...this.columns,
              ...r.result[0].expand?.map(v => ({
                title: v.columnName,
                dataIndex: v.columnKey,
                key: v.columnKey,
              })),
            ]
            r.result.forEach(v => {
              if (v.expand?.length) {
                v.expand.forEach(v2 => {
                  v[v2['columnKey']] = v2['columnValue']
                })
              }
            })
          }
          this.data = r.result
          console.log(r)
        })
    },
  },
}
</script>
<style src="./common.css" />
<style scoped lang="less">
/deep/ .ant-table-thead th {
  background-color: rgba(6, 95, 221, 1);
}
/deep/ .ant-table-wrapper {
  width: 95%;
  margin: 0 auto;
}
/deep/ .ant-table-wrapper th,
/deep/ .ant-table-tbody td {
  color: #fff;
}
/deep/ .ant-table-tbody td {
  background-color: rgba(1, 55, 180, 1);
}
.section_2 {
  width: 100vw;
  min-height: 100vh;
  background-color: rgb(6, 95, 222);
  background-size: 100% 100%;
  .section_3 {
    background-color: rgba(3, 37, 146, 1);
    width: 100vw;
    height: 4.17vw;
    .text_1 {
      width: 10.58vw;
      height: 1.57vw;
      overflow-wrap: break-word;
      color: rgba(255, 255, 255, 1);
      font-size: 1.61vw;
      font-family: AlimamaShuHeiTi-Bold;
      font-weight: 700;
      text-align: left;
      white-space: nowrap;
      line-height: 1.62vw;
      margin: 1.3vw 0 0 3.17vw;
    }
    .box_2 {
      position: relative;
      width: 25.68vw;
      height: 4.17vw;
      margin-left: 11.15vw;
      .box_3 {
        background-color: rgba(255, 207, 14, 1);
        width: 8.73vw;
        height: 4.17vw;
        margin-left: 13.75vw;
      }
      .text-wrapper_1 {
        position: absolute;
        left: 0;
        top: 1.57vw;
        width: 25.68vw;
        height: 1.05vw;
        overflow-wrap: break-word;
        font-size: 0;
        font-family: AlibabaPuHuiTi-Regular;
        font-weight: normal;
        text-align: left;
        white-space: nowrap;
        line-height: 1.05vw;
        .text_2 {
          width: 25.68vw;
          height: 1.05vw;
          overflow-wrap: break-word;
          color: rgba(255, 255, 255, 1);
          font-size: 1.04vw;
          font-family: AlibabaPuHuiTi-Regular;
          font-weight: normal;
          text-align: left;
          white-space: nowrap;
          line-height: 1.05vw;
        }
        .text_3 {
          width: 25.68vw;
          height: 1.05vw;
          overflow-wrap: break-word;
          color: rgba(255, 255, 255, 1);
          font-size: 1.04vw;
          font-family: AlibabaPuHuiTi-Bold;
          font-weight: 700;
          text-align: left;
          white-space: nowrap;
          line-height: 1.05vw;
        }
        .text_4 {
          width: 25.68vw;
          height: 1.05vw;
          overflow-wrap: break-word;
          color: rgba(3, 37, 146, 1);
          font-size: 1.04vw;
          font-family: AlibabaPuHuiTi-Bold;
          font-weight: 700;
          text-align: left;
          white-space: nowrap;
          line-height: 1.05vw;
        }
        .text_5 {
          width: 25.68vw;
          height: 1.05vw;
          overflow-wrap: break-word;
          color: rgba(255, 255, 255, 1);
          font-size: 1.04vw;
          font-family: AlibabaPuHuiTi-Regular;
          font-weight: normal;
          text-align: left;
          white-space: nowrap;
          line-height: 1.05vw;
        }
      }
    }
    .text-wrapper_2 {
      width: 18.29vw;
      height: 2.24vw;
      margin: 0.93vw 0 0 21.71vw;
      .text_6 {
        width: 18.29vw;
        height: 0.84vw;
        overflow-wrap: break-word;
        color: rgba(255, 255, 255, 1);
        font-size: 0.83vw;
        font-family: AlibabaPuHuiTi-Regular;
        font-weight: normal;
        text-align: left;
        white-space: nowrap;
        line-height: 0.84vw;
      }
      .text_7 {
        width: 6.83vw;
        height: 0.84vw;
        overflow-wrap: break-word;
        color: rgba(255, 255, 255, 1);
        font-size: 0.83vw;
        font-family: AlibabaPuHuiTi-Regular;
        font-weight: normal;
        text-align: left;
        white-space: nowrap;
        line-height: 0.84vw;
        margin-top: 0.58vw;
      }
    }
    .text-wrapper_3 {
      background-color: rgba(255, 207, 14, 1);
      height: 2.09vw;
      width: 4.33vw;
      margin: 1.04vw 3.9vw 0 1.19vw;
      .text_8 {
        width: 3.08vw;
        height: 0.79vw;
        overflow-wrap: break-word;
        color: rgba(3, 37, 146, 1);
        font-size: 0.83vw;
        font-family: AlibabaPuHuiTi-Regular;
        font-weight: normal;
        text-align: left;
        white-space: nowrap;
        line-height: 0.84vw;
        margin: 0.62vw 0 0 0.62vw;
      }
    }
  }
  .section_4 {
    background-color: rgba(3, 37, 146, 0.68);
    position: relative;
    width: 93.75vw;

    margin: 3.17vw 0 3.12vw 3.12vw;
    .text_9 {
      width: 3.39vw;
      height: 1.89vw;
      overflow-wrap: break-word;
      color: rgba(255, 255, 255, 1);
      font-size: 0.93vw;
      font-family: AlibabaPuHuiTi-Bold;
      font-weight: 700;
      text-align: left;
      white-space: nowrap;
      line-height: 0.94vw;
      margin: 2.13vw 0 0 2.91vw;
    }
  }
}
</style>
